package com.lxq.dao.impl;

import java.sql.Connection;
import java.sql.SQLException;

import com.lxq.common.DbHelper;
import com.lxq.dao.UserDao;
import com.lxq.dao.impl.common.BaseDaoImpl;
import com.lxq.entity.User;

public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao{
/**
 * 通过phone查找user
 */
	@Override
	public User findByPhone(String phoneNumber) {
		User user = new User();
		Connection conn = null;
		String sql = "select * from " + getTableName() + " where phoneNumber=?";
		try {
			conn = DbHelper.getConn();
			user = qr.query(conn, sql, beanHandler, phoneNumber);
			
		} catch (SQLException e) {
		
			e.printStackTrace();
			
		}finally{
			if(conn != null){
				DbHelper.close(conn);
			}
		}
		return user;
	}
	

}
